//
//  NBLayerUtils.h
//  automobiledashboard
//
//  Created by 王建华 on 2025/9/26.
//

#import <UIKit/UIKit.h>

#define isPad ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)

NS_ASSUME_NONNULL_BEGIN

@interface NBLayerUtils : UIView


/// 添加渐变背景色 从左到右
/// - Parameters:
///   - layerFrame: frame
///   - view: 视图
///   - colorArr: 颜色
///   - locations: 位置
+ (void)addgradintLayerWithFram:(CGRect)layerFrame
                        andView:(UIView *)view
                      andColors:(NSArray *)colorArr
                   andLocations:(NSArray *)locations;

/// 添加渐变背景色 指定开始停止位置
/// - Parameters:
///   - layerFrame: frame
///   - view: 视图
///   - colorArr: 颜色
///   - startP: 起始位置
///   - endP: 终点位置
///   - locations: 颜色数组对应位置
+ (void)addgradintLayerWithFram:(CGRect)layerFrame
                        andView:(UIView *)view
                      andColors:(NSArray *)colorArr
                  andStartPoint:(CGPoint)startP
                    andEndPoint:(CGPoint)endP
                   andLocations:(nonnull NSArray *)locations;

@end

NS_ASSUME_NONNULL_END
